home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Dialogs.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
14KB
|
465 lines
{
File: Dialogs.p
Contains: Dialog Manager interfaces.
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Dialogs;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __DIALOGS__}
{$SETC __DIALOGS__ := 1}
{$I+}
{$SETC DialogsIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __ERRORS__}
{$I Errors.p}
{$ENDC}
{$IFC UNDEFINED __MEMORY__}
{$I Memory.p}
{$ENDC}
{$IFC UNDEFINED __MENUS__}
{$I Menus.p}
{$ENDC}
{$IFC UNDEFINED __CONTROLS__}
{$I Controls.p}
{$ENDC}
{$IFC UNDEFINED __WINDOWS__}
{$I Windows.p}
{$ENDC}
{$IFC UNDEFINED __TEXTEDIT__}
{$I TextEdit.p}
{$ENDC}
{$IFC UNDEFINED __EVENTS__}
{$I Events.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
CONST
ctrlItem = 4;
btnCtrl = 0;
chkCtrl = 1;
radCtrl = 2;
resCtrl = 3;
statText = 8;
editText = 16;
iconItem = 32;
picItem = 64;
userItem = 0;
itemDisable = 128;
ok = 1;
cancel = 2;
stopIcon = 0;
noteIcon = 1;
cautionIcon = 2;
{ new, more standard names for dialog item constants }
kControlDialogItem = 4;
kButtonDialogItem = 4;
kCheckBoxDialogItem = 5;
kRadioButtonDialogItem = 6;
kResourceControlDialogItem = 7;
kStaticTextDialogItem = 8;
kEditTextDialogItem = 16;
kIconDialogItem = 32;
kPictureDialogItem = 64;
kUserDialogItem = 0; { misc. constants }
kItemDisableBit = 128;
kStdOkItemIndex = 1;
kStdCancelItemIndex = 2; { standard icon resource id's }
kStopIcon = 0;
kNoteIcon = 1;
kCautionIcon = 2;
{$IFC OLDROUTINENAMES }
{
These constants lived briefly on ETO 16. They suggest
that there is only one index you can use for the OK
item, which is not true. You can put the ok item
anywhere you want in the DITL.
}
kOkItemIndex = 1;
kCancelItemIndex = 2;
{$ENDC}
{ Dialog Item List Manipulation Constants }
TYPE
DITLMethod = SInt16;
CONST
overlayDITL = 0;
appendDITLRight = 1;
appendDITLBottom = 2;
TYPE
StageList = SInt16;
DialogRef = DialogPtr;
DialogRecordPtr = ^DialogRecord;
DialogRecord = RECORD
window: WindowRecord;
items: Handle;
textH: TEHandle;
editField: SInt16;
editOpen: SInt16;
aDefItem: SInt16;
END;
DialogPeek = ^DialogRecord;
DialogTemplatePtr = ^DialogTemplate;
DialogTemplate = RECORD
boundsRect: Rect;
procID: SInt16;
visible: BOOLEAN;
filler1: BOOLEAN;
goAwayFlag: BOOLEAN;
filler2: BOOLEAN;
refCon: SInt32;
itemsID: SInt16;
title: Str255;
END;
DialogTPtr = ^DialogTemplate;
DialogTHndl = ^DialogTPtr;
AlertTemplatePtr = ^AlertTemplate;
AlertTemplate = RECORD
boundsRect: Rect;
itemsID: SInt16;
stages: StageList;
END;
AlertTPtr = ^AlertTemplate;
AlertTHndl = ^AlertTPtr;
{ new type abstractions for the dialog manager }
DialogItemIndexZeroBased = SInt16;
DialogItemIndex = SInt16;
DialogItemType = SInt16;
{ dialog manager callbacks }
SoundProcPtr = ProcPtr; { PROCEDURE Sound(soundNumber: SInt16); }
SoundUPP = UniversalProcPtr;
CONST
uppSoundProcInfo = $00000080;
FUNCTION NewSoundProc(userRoutine: SoundProcPtr): SoundUPP;
{$IFC NOT GENERATINGCFM }
INLINE $2E9F;
{$ENDC}
PROCEDURE CallSoundProc(soundNumber: SInt16; userRoutine: SoundUPP);
{$IFC NOT GENERATINGCFM}
INLINE $205F, $4E90;
{$ENDC}
TYPE
ModalFilterProcPtr = ProcPtr; { FUNCTION ModalFilter(theDialog: DialogRef; VAR theEvent: EventRecord; VAR itemHit: DialogItemIndex): BOOLEAN; }
ModalFilterUPP = UniversalProcPtr;
CONST
uppModalFilterProcInfo = $00000FD0;
FUNCTION NewModalFilterProc(userRoutine: ModalFilterProcPtr): ModalFilterUPP;
{$IFC NOT GENERATINGCFM }
INLINE $2E9F;
{$ENDC}
FUNCTION CallModalFilterProc(theDialog: DialogRef; VAR theEvent: EventRecord; VAR itemHit: DialogItemIndex; userRoutine: ModalFilterUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $205F, $4E90;
{$ENDC}
TYPE
UserItemProcPtr = ProcPtr; { PROCEDURE UserItem(theWindow: WindowRef; itemNo: DialogItemIndex); }
UserItemUPP = UniversalProcPtr;
CONST
uppUserItemProcInfo = $000002C0;
FUNCTION NewUserItemProc(userRoutine: UserItemProcPtr): UserItemUPP;
{$IFC NOT GENERATINGCFM }
INLINE $2E9F;
{$ENDC}
PROCEDURE CallUserItemProc(theWindow: WindowRef; itemNo: DialogItemIndex; userRoutine: UserItemUPP);
{$IFC NOT GENERATINGCFM}
INLINE $205F, $4E90;
{$ENDC}
{
NOTE: Code running under MultiFinder or System 7.0 or newer
should always pass NULL to InitDialogs.
}
PROCEDURE InitDialogs(ignored: UNIV Ptr);
{$IFC NOT GENERATINGCFM}
INLINE $A97B;
{$ENDC}
PROCEDURE ErrorSound(soundProc: SoundUPP);
{$IFC NOT GENERATINGCFM}
INLINE $A98C;
{$ENDC}
FUNCTION NewDialog(wStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowRef; goAwayFlag: BOOLEAN; refCon: SInt32; itmLstHndl: Handle): DialogRef;
{$IFC NOT GENERATINGCFM}
INLINE $A97D;
{$ENDC}
FUNCTION GetNewDialog(dialogID: SInt16; dStorage: UNIV Ptr; behind: WindowRef): DialogRef;
{$IFC NOT GENERATINGCFM}
INLINE $A97C;
{$ENDC}
FUNCTION NewColorDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowRef; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogRef;
{$IFC NOT GENERATINGCFM}
INLINE $AA4B;
{$ENDC}
PROCEDURE CloseDialog(theDialog: DialogRef);
{$IFC NOT GENERATINGCFM}
INLINE $A982;
{$ENDC}
PROCEDURE DisposeDialog(theDialog: DialogRef);
{$IFC NOT GENERATINGCFM}
INLINE $A983;
{$ENDC}
PROCEDURE ModalDialog(modalFilter: ModalFilterUPP; VAR itemHit: DialogItemIndex);
{$IFC NOT GENERATINGCFM}
INLINE $A991;
{$ENDC}
FUNCTION IsDialogEvent({CONST}VAR theEvent: EventRecord): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $A97F;
{$ENDC}
FUNCTION DialogSelect({CONST}VAR theEvent: EventRecord; VAR theDialog: DialogRef; VAR itemHit: DialogItemIndex): BOOLEAN;
{$IFC NOT GENERATINGCFM}
INLINE $A980;
{$ENDC}
PROCEDURE DrawDialog(theDialog: DialogRef);
{$IFC NOT GENERATINGCFM}
INLINE $A981;
{$ENDC}
PROCEDURE UpdateDialog(theDialog: DialogRef; updateRgn: RgnHandle);
{$IFC NOT GENERATINGCFM}
INLINE $A978;
{$ENDC}
PROCEDURE HideDialogItem(theDialog: DialogRef; itemNo: DialogItemIndex);
{$IFC NOT GENERATINGCFM}
INLINE $A827;
{$ENDC}
PROCEDURE ShowDialogItem(theDialog: DialogRef; itemNo: DialogItemIndex);
{$IFC NOT GENERATINGCFM}
INLINE $A828;
{$ENDC}
FUNCTION FindDialogItem(theDialog: DialogRef; thePt: Point): DialogItemIndexZeroBased;
{$IFC NOT GENERATINGCFM}
INLINE $A984;
{$ENDC}
PROCEDURE DialogCut(theDialog: DialogRef);
PROCEDURE DialogPaste(theDialog: DialogRef);
PROCEDURE DialogCopy(theDialog: DialogRef);
PROCEDURE DialogDelete(theDialog: DialogRef);
FUNCTION Alert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
{$IFC NOT GENERATINGCFM}
INLINE $A985;
{$ENDC}
FUNCTION StopAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
{$IFC NOT GENERATINGCFM}
INLINE $A986;
{$ENDC}
FUNCTION NoteAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
{$IFC NOT GENERATINGCFM}
INLINE $A987;
{$ENDC}
FUNCTION CautionAlert(alertID: SInt16; modalFilter: ModalFilterUPP): DialogItemIndex;
{$IFC NOT GENERATINGCFM}
INLINE $A988;
{$ENDC}
PROCEDURE GetDialogItem(theDialog: DialogRef; itemNo: DialogItemIndex; VAR itemType: DialogItemType; VAR item: Handle; VAR box: Rect);
{$IFC NOT GENERATINGCFM}
INLINE $A98D;
{$ENDC}
PROCEDURE SetDialogItem(theDialog: DialogRef; itemNo: DialogItemIndex; itemType: DialogItemType; item: Handle; {CONST}VAR box: Rect);
{$IFC NOT GENERATINGCFM}
INLINE $A98E;
{$ENDC}
PROCEDURE ParamText(param0: Str255; param1: Str255; param2: Str255; param3: Str255);
{$IFC NOT GENERATINGCFM}
INLINE $A98B;
{$ENDC}
PROCEDURE SelectDialogItemText(theDialog: DialogRef; itemNo: DialogItemIndex; strtSel: SInt16; endSel: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $A97E;
{$ENDC}
PROCEDURE GetDialogItemText(item: Handle; VAR text: Str255);
{$IFC NOT GENERATINGCFM}
INLINE $A990;
{$ENDC}
PROCEDURE SetDialogItemText(item: Handle; text: Str255);
{$IFC NOT GENERATINGCFM}
INLINE $A98F;
{$ENDC}
FUNCTION GetAlertStage: SInt16;
{$IFC NOT GENERATINGCFM}
INLINE $3EB8, $0A9A;
{$ENDC}
PROCEDURE SetDialogFont(value: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $31DF, $0AFA;
{$ENDC}
PROCEDURE ResetAlertStage;
{$IFC NOT GENERATINGCFM}
INLINE $4278, $0A9A;
{$ENDC}
PROCEDURE AppendDITL(theDialog: DialogRef; theHandle: Handle; method: DITLMethod);
FUNCTION CountDITL(theDialog: DialogRef): DialogItemIndex;
PROCEDURE ShortenDITL(theDialog: DialogRef; numberItems: DialogItemIndex);
FUNCTION StdFilterProc(theDialog: DialogRef; VAR event: EventRecord; VAR itemHit: DialogItemIndex): BOOLEAN;
FUNCTION GetStdFilterProc(VAR theProc: ModalFilterUPP): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $303C, $0203, $AA68;
{$ENDC}
FUNCTION SetDialogDefaultItem(theDialog: DialogRef; newItem: DialogItemIndex): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $303C, $0304, $AA68;
{$ENDC}
FUNCTION SetDialogCancelItem(theDialog: DialogRef; newItem: DialogItemIndex): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $303C, $0305, $AA68;
{$ENDC}
FUNCTION SetDialogTracksCursor(theDialog: DialogRef; tracks: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $303C, $0306, $AA68;
{$ENDC}
{$IFC OLDROUTINENAMES }
PROCEDURE DisposDialog(theDialog: DialogRef);
{$IFC NOT GENERATINGCFM}
INLINE $A983;
{$ENDC}
PROCEDURE UpdtDialog(theDialog: DialogRef; updateRgn: RgnHandle);
{$IFC NOT GENERATINGCFM}
INLINE $A978;
{$ENDC}
PROCEDURE GetDItem(theDialog: DialogRef; itemNo: DialogItemIndex; VAR itemType: DialogItemType; VAR item: Handle; VAR box: Rect);
{$IFC NOT GENERATINGCFM}
INLINE $A98D;
{$ENDC}
PROCEDURE SetDItem(theDialog: DialogRef; itemNo: DialogItemIndex; itemType: DialogItemType; item: Handle; {CONST}VAR box: Rect);
{$IFC NOT GENERATINGCFM}
INLINE $A98E;
{$ENDC}
PROCEDURE HideDItem(theDialog: DialogRef; itemNo: DialogItemIndex);
{$IFC NOT GENERATINGCFM}
INLINE $A827;
{$ENDC}
PROCEDURE ShowDItem(theDialog: DialogRef; itemNo: DialogItemIndex);
{$IFC NOT GENERATINGCFM}
INLINE $A828;
{$ENDC}
PROCEDURE SelIText(theDialog: DialogRef; itemNo: DialogItemIndex; strtSel: SInt16; endSel: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $A97E;
{$ENDC}
PROCEDURE GetIText(item: Handle; VAR text: Str255);
{$IFC NOT GENERATINGCFM}
INLINE $A990;
{$ENDC}
PROCEDURE SetIText(item: Handle; text: Str255);
{$IFC NOT GENERATINGCFM}
INLINE $A98F;
{$ENDC}
FUNCTION FindDItem(theDialog: DialogRef; thePt: Point): DialogItemIndexZeroBased;
{$IFC NOT GENERATINGCFM}
INLINE $A984;
{$ENDC}
FUNCTION NewCDialog(dStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: SInt16; behind: WindowRef; goAwayFlag: BOOLEAN; refCon: SInt32; items: Handle): DialogRef;
{$IFC NOT GENERATINGCFM}
INLINE $AA4B;
{$ENDC}
PROCEDURE DlgCut(theDialog: DialogRef);
PROCEDURE DlgPaste(theDialog: DialogRef);
PROCEDURE DlgCopy(theDialog: DialogRef);
PROCEDURE DlgDelete(theDialog: DialogRef);
PROCEDURE SetDAFont(fontNum: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $31DF, $0AFA;
{$ENDC}
{$ENDC}
{
*****************************************************************************
* *
* The conditional STRICT_DIALOGS has been removed from this interface file. *
* The accessor macros to a DialogRecord are no longer necessary. *
* *
*****************************************************************************
Details:
The original purpose of the STRICT_ conditionals and accessor macros was to
help ease the transition to Copland. Shared data structures are difficult
to coordinate in a preemptive multitasking OS. By hiding the fields in a
WindowRecord and other data structures, we would begin the migration to
system data structures being completely hidden from applications.
After many design reviews, it was finally concluded that with this sort of
migration, the system could never tell when an application was no longer
peeking at a WindowRecord, and thus the data structure might never become
system owned. Additionally, there were many other limitations in the classic
toolbox that were begging to be addressed.
The final decision was to leave the traditional toolbox as a compatibility mode.
The preferred toolbox API for Copland is a new SOM(tm) based architecture
(e.g. HIWindows.idl). Windows, menu, controls, etc are each a SOM object
with methods for drawing, event handling, and customization.
}
{$ENDC}
{$IFC FOR_SYSTEM7_ONLY }
PROCEDURE CouldDialog(dialogID: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $A979;
{$ENDC}
PROCEDURE FreeDialog(dialogID: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $A97A;
{$ENDC}
PROCEDURE CouldAlert(alertID: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $A989;
{$ENDC}
PROCEDURE FreeAlert(alertID: SInt16);
{$IFC NOT GENERATINGCFM}
INLINE $A98A;
{$ENDC}
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := DialogsIncludes}
{$ENDC} {__DIALOGS__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}